package db.tables;

import java.sql.SQLException;

import org.hsqldb.Types;

import db.DBObject;

public class DBTownTable extends DBObject {
	public static final String TABLE_NAME = "town";

	public static final String TOWN_ID_COL = "town_id",
			COUNTRY_ID_COL = DBCountryTable.COUNTRY_ID_COL,
			POSTAL_CODE_COL = "postal_code", TOWN_NAME_COL = "town_name";

	public DBTownTable() throws ClassNotFoundException, SQLException {
		super(TABLE_NAME, new Object[][] {
				{ TOWN_ID_COL, Types.BIGINT, SQL_IDENTITY_PRIMARY_KEY, "" },
				{ COUNTRY_ID_COL, Types.BIGINT, "", "" },
				{ POSTAL_CODE_COL, Types.INTEGER, SQL_NOT_NULL, "" },
				{ TOWN_NAME_COL, Types.VARCHAR, SQL_NOT_NULL+getSQLForeignKeyReference(DBCountryTable.TABLE_NAME, COUNTRY_ID_COL), "" } });
	}
}